package erp.education.server.db.implementation.setup.school;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Component;

import erp.education.server.db.entites.setup.school.BranchToCourse;
import erp.education.server.db.implementation.common.BaseDAO;
import erp.education.server.db.interfaces.setup.school.BranchToCourseDAOI;

@Component("branchToCourseDao")
public class BranchToCourseDAO extends BaseDAO implements BranchToCourseDAOI {

	@Override
	public BranchToCourse getBranchToCourse(Long branchId, Long courseId) {
		// TODO Auto-generated method stub
		BranchToCourse branchCourse = null;
		Map params = new HashMap();
		params.put("branchId", branchId);
		params.put("courseId", courseId);

		branchCourse = (BranchToCourse) getSingleResult(
				"select branchCourse from BranchToCourse branchCourse where branchCourse.branchId=:branchId and branchCourse.courseId=:courseId",
				params);

		return branchCourse;
	}

}
